class Animal:
    def run(self):
        raise AttributeError('子类必须实现这个方法')

class People(Animal):
    def run(self):
        print("people is running")

class Pig(Animal):
    def run(self):
        print("pig is walking")

class Dog(Animal):
    def run(self):
        print("dog is running")

def func(animal): # animal只是一个变量名，叫做什么都可以
    animal.run()

func(Pig())